
let executor = (resolve,reject)=>{
    resolve('兑现');
    reject('拒绝'); 
}

// 通过 Promise 构造函数创建一个新的 Promise实例
let p = new Promise( executor );

let onFulfilled = (...params) => {
    console.log('fulfilled: ' , params);
}

let onRejected = (...params) => {
    console.log('rejected: ' , params);
}

let ending = (...params) => {
    console.log('ending: ' , params);
}

p.then( onFulfilled ).catch( onRejected ).finally( ending );